import React,{Component,PropTypes} from "react";
import {connect} from "react-redux";
class Counter extends Component{
	static propTypes={
		value:PropTypes.number.isRequired,
		onIncreaseClick:PropTypes.func.isRequired
	};
	render(){
		const{value,onIncreaseClick}=this.props;
		return(
				<div>
					<span>{value}</span>
					<button onClick={onIncreaseClick}>Increase</button>
				</div>
			)
	}
}
const increaseAction={type:"increase"}


function mapStateToProps(state){
	return{
		value:state.count
	}
}
// function mapDispatchToProps(dispatch){
// 	return{
// 		onIncreaseClick:()=>dispatch(increaseAction)
// 	}
// }
const mapDispatchToProps={
	onIncreaseClick:()=>(increaseAction)
}

const App=connect(
		mapStateToProps,
		mapDispatchToProps
	)(Counter)

export default App;